package com.lcf.system.entity;

import com.lcf.framework.model.BaseNoTenantModel;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.NoArgsConstructor;

import java.math.BigDecimal;
import java.time.LocalDateTime;

/**
 * 收入记录(PriceRecord)表实体类
 *
 * @author lcf
 * @since 2025-05-02 11:55:01
 */
@EqualsAndHashCode(callSuper = true)
@Data
@NoArgsConstructor
public class PriceRecord extends BaseNoTenantModel<PriceRecord> {
    //id
    private Long id;
    //用户id
    private Long userId;
    //收入金额
    private BigDecimal earnPrice;
    //购买用户id
    private Long buyUserId;
    //订单编号
    private String orderNo;
    //下单时间
    private LocalDateTime orderTime;

    public PriceRecord(long userId, BigDecimal earnPrice, long buyUserId, String orderNo) {
        this.userId = userId;
        this.earnPrice = earnPrice;
        this.buyUserId = buyUserId;
        this.orderNo = orderNo;
        this.orderTime = LocalDateTime.now();
    }
}

